/**
 * Created by aa on 2016/10/13.
 */
'use strict';
var utils=require('../common/utils');
var cac=utils.cac;
var receiveDetailContent;
//获取公司历程
const RECEIVE_DETAIL_CONTENT='RECEIVE_DETAIL_CONTENT';

//对外暴露变量
exports.RECEIVE_DETAIL_CONTENT=RECEIVE_DETAIL_CONTENT;

//action构造方法
exports.receiveDetailContent=receiveDetailContent=cac(RECEIVE_DETAIL_CONTENT,'detailContent');

exports.getArticleDetail=(id)=>{
    return (dispatch, getState) => {
        reqwest({
            url: `/api/articleDetail?id=${id}`,
            method: 'get',
            contentType: 'application/json'
        })
            .then(function (data) {
                dispatch(receiveDetailContent(data));
            })
            .fail(function (err, msg) {
                alert('获取数据出错');
            })
    }
};
